﻿@model RedSand.Site.Models.RequestInfo
@if (User.Identity.IsAuthenticated)
{
    using (Ajax.BeginForm("PostRequest", "Request", new AjaxOptions { OnSuccess = "PostRequest" }))
    {
    <div class="box-request-ineed">
        <h4>
            Gửu yêu cầu</h4>
        <div class="row">
            <label>
                Tiêu đề</label>
            @Html.TextBoxFor(m => m.Title, new { @class = "txt_Small" })
        </div>
        <div class="row">
            <label>
                Nội dung yêu cầu</label>
                <textarea style="resize:none" name="Content" class="txt_Small"></textarea>
            <input type="submit" value="Gửu yêu cầu" />
        </div>
    </div>
    }
    <script type="text/javascript">
        function PostRequest(data) {
            jAlert(data);
            $('#panel-dialog-ineed').dialog('close')
        }
        $(document).ready(function () {
            $('#panel-dialog-ineed').dialog({
                autoOpen: true,
                width: '375px'
            })
        })
    </script>
}
else
{
    @Html.Action("PanelLogin", "Account")
    <script type="text/javascript">
        $(document).ready(function () {
            $('#panel-dialog-ineed').dialog({
                autoOpen: true,
                width: '710px'
            })
            $('#panel-dialog-ineed #panel-login:last').css('display', 'block');
        })
    </script>
}